package cn.wk;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootApplication
@MapperScan("cn.wk.*.mapper")
public class App {
    public static ConfigurableApplicationContext run;
    public static void main(String[] args) {
        run = SpringApplication.run(App.class);
    }
    //返回一个RedisTemplate
    public static RedisTemplate redisTemplate(){
        RedisTemplate redisTemplate = run.getBean("redisTemplate", RedisTemplate.class);
        return redisTemplate;
    }


}
